{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <input type="hidden" name="id" value="{$data.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">服务项目</label>
        <div class="layui-input-block">
            <input value="{$server_info.name}" type="text" name="title" lay-verify="required" autocomplete="off" placeholder="服务项目"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <div class="w300">
                <input  hidden="hidden" value="{$server_info.bc_img}" type="text" lay-verify="required" name="img" id="c-pic" value="" class="layui-input">
            </div>
            <button  type="button" class="layui-btn faupload" id="faupload-pic" data-multiple="false"
                    data-input-id="c-pic"
                    data-preview-id="p-pic" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button   type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic" id="fachoose-c-pic"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic"></ul>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">服务项目次数</label>
        <div class="layui-input-block">
            <input  value="{$member_package_server_info.server_num}" type="text" name="sort" lay-verify="required|Number" autocomplete="off" placeholder="服务项目次数"
                   class="layui-input">
        </div>
    </div>







</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['form', 'yznForm'], function () {
        var yznForm = layui.yznForm;
        var form = layui.form;
        yznForm.bindevent($("form.layui-form"));
        form.on('select(ccc6)', function (data) {
            console.log(data.value);
            $.ajax({
                type: "POST",//规定传输方式
                url: "{:url('getc_cate')}",//提交URL
                data: {'id': data.value},//提交的数据
                success: function (result) {
                    if (result.code == 200) {
                        $("#c-city").empty();
                        var str = "<option value>请选择市</option>";
                        $.each(result.data, function (i, val) {
                            str += '<option value=' + val.id + '>' + val.name + '</option>'
                        });
                        $("#c-city").append(str);
                        layui.form.render('select');
                    }
                },
                error: function () {
                    alert("获取信息失败")
                }
            });
            form.render();
        });
    });
</script>
{/block}